#ifndef _RESULT_H_
#define _RESULT_H_

#include <stdlib.h>
#include <stdio.h>
#include <string>
#include <list>
#include <assert.h>
using namespace std;

struct result_t
{
	string url;
	string context; //
	int count;       // count in this url
	time_t check_time;
};
result_t* create_result(char* url, char* context, int count, time_t& check_time);
void release_result(result_t* result);

struct result_union_t
{
	string word;
	list<result_t*> results;
};

result_union_t* create_result_union(const string& word);
void release_result_union(result_union_t* result_union);
int add_result(result_union_t* result_union, result_t* result);

void show_result(int fd,const string& word, result_union_t* result_union);
#endif

